<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>glMatrix API详解</title>
</head>
<body>
<script type="module">
  import * as mat4 from '../assets/js/gl-matrix/esm/mat4.js';

  const matrix = mat4.create();
  console.log(' =====', matrix);

  mat4.perspective(matrix, 45, 4 / 3, 1, 100);

  const matrix1 = mat4.create();
  let target = [];
  mat4.multiply(target, matrix, matrix1);
  console.log('矩阵相乘 =====', target);

  mat4.identity(matrix);
  console.log('单位矩阵 =====', matrix);

  mat4.translate(matrix, matrix, [10, 10, 10]);
  console.log('矩阵平移 =====', matrix);

  mat4.scale(matrix, matrix, [1, 2, 1]);
  console.log('矩阵缩放 =====', matrix);

  mat4.rotate(matrix, matrix, 45, [0, 1, 0]);
  console.log('矩阵旋转 =====', matrix);

</script>
</body>
</html>